Change the shortcut for Focus Sidebar to not interfere with text editing#2796
Change the shortcut for Focus Sidebar to not interfere with text editing#2796stan-janssen wants to merge 3 commits into
Conversation
|
See also elementary/code#1719. It would be good to agree on a common shortcut to switch to and from the sidebar. I think |
|
Thanks, I will update this PR to change the keyboard shortcut to |
The existing <ctrl>+Left would interfere when editing a filename Closes elementary#2677.
c09998d to
c78645f
Compare
|
(A thing that comes to mind: do people with a RTL (Right-To-Left) setting see the sidebar on the right side? And isn't a fixed directional-key shortcut confusing in that case? I assume that this won't be the only place this is encountered...) |
|
Heiy everyone. |
|
I installed the Arabic language and took a look, and indeed the sidebar is on the right, and I still have to press I don't think this should block this PR, because it is not a regression to the current status, but I wonder if there is something in some of the underlying libraries that might help with abstracting this. If there isn't, perhaps directional arrow keys should only be used very cautiously in shortcuts. |
|
I agree that dealing with RTL locales should be dealt with but can be done in another PR. It should be simple enough to alter the actions depending on the StateFlagsof the window (DIR_RTL or not). |
jeremypw
left a comment
There was a problem hiding this comment.
This works as expected, thanks. I think that we should change the corresponding <Ctrl>Right shortcut as well though to maintain consistency?
I can't find an existing Should I implement a I'd be happy to add it. |
|
Hmm, both I don't think adding |
|
I added an explicit accelerator for focusing on the current container (this re-uses the existing focus logic that was already present). I'll add a separate PR (that builds on this one) that ensures proper directionality of accelerators in RTL languages. |
|
@stan-janssen Looks good from my side🎉 |
jeremypw
left a comment
There was a problem hiding this comment.
Not working at the moment because of wrong action name in shortcut definition.
| marlin_app.set_accels_for_action ("win.tab::WINDOW", {"<Ctrl><Alt>N"}); | ||
| marlin_app.set_accels_for_action ("win.focus-sidebar", {"<Ctrl>Left"}); | ||
| marlin_app.set_accels_for_action ("win.focus-sidebar", {"<Ctrl><Alt>Left"}); | ||
| marlin_app.set_accels_for_action ("win.focus-tabview", {"<Ctrl><Alt>Right"}); |
There was a problem hiding this comment.
The action must be win.focus-current-container otherwise it doesn't work.
|
Might be better to focus on the follow-up PR which superceded this one anyway. |
The existing
<Ctrl> + Leftwould interfere when editing a filename.Closes #2677.